package com.zm.tools;

import java.util.List;
/**
 * 分页显示类
 * Created by Administrator on 2018/9/14.
 */
public class PageDto<T> {
    //给页面
       //每页显示多少条
    private int pagesize=3;
    //总共多少页
    private int totapages;
    //总共多少数据
    private int totalcount;
    //当前页数
    private int pagenum;
    //数据
    private List<T> list;
    //请求地址
    private String urlpath;

    //给后台
    private int start;
    private T querydata;

    //必须要伟pagenum,totalcount

    public PageDto(int pagenum, int totalcount) {
        this.pagenum = pagenum;
        this.totalcount = totalcount;
        this.totapages=(totalcount+pagesize-1)/pagesize;
        this.start=(pagenum-1)*pagesize;
    }

    public int getPagesize() {
        return pagesize;
    }

    public void setPagesize(int pagesize) {
        this.pagesize = pagesize;
    }

    public int getTotapages() {
        return totapages;
    }

    public void setTotapages(int totapages) {
        this.totapages = totapages;
    }

    public int getTotalcount() {
        return totalcount;
    }

    public void setTotalcount(int totalcount) {
        this.totalcount = totalcount;
    }

    public int getPagenum() {
        return pagenum;
    }

    public void setPagenum(int pagenum) {
        this.pagenum = pagenum;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public String getUrlpath() {
        return urlpath;
    }

    public void setUrlpath(String urlpath) {
        this.urlpath = urlpath;
    }

    public int getStart() {
        return start;
    }

    public void setStart(int start) {
        this.start = start;
    }

    public T getQuerydata() {
        return querydata;
    }

    public void setQuerydata(T querydata) {
        this.querydata = querydata;
    }
}
